sizegroups: Use is_visible() instead of get_mapped() for visibility
authorBenjamin Otte <otte@redhat.com>
Thu, 1 Nov 2012 23:44:30 +0000 (00:44 +0100)
committerBenjamin Otte <otte@redhat.com>
Sun, 4 Nov 2012 14:24:17 +0000 (15:24 +0100)
commitbe1bde91112c80ddc475547db0d5cfabdff7f046
tree6fa7020764637da5c2b3a1892692e4f7db2f9047
parent48ff2fc7ed1f418002def55fc496a7f86f9e7ef7
sizegroups: Use is_visible() instead of get_mapped() for visibility

The current approach of using gtk_widget_get_mapped() is broken:
The usual steps taken when showing a window are:
(1) request the sizes
(2) allocate the sizes
(3) show the window in the allocated size

Showing the window with a random size between steps (1) and (2) would of
course
result in extra work and potential flickering when the widgets get
resized to
their proper sizes.

However, as GtkSizeGroup::ignore-hidden uses gtk_widget_get_mapped() to
determine visibility for a widget, the following will happen:
(1) the widget will request a 0 size
(2) the widget will be allocated a 0 size
(3) the widget will be too small when it is shown

gtk_widget_get_visible() however is set in advance. Note that toggling
visibility also causes a gtk-widget_queue_resize() call already so we
take care of changes in here automatically.
gtk/gtksizegroup.c